package lab02.test30;

import java.util.Scanner;
//从键盘读取一个考试分数列表，计算它们的平均分
public class Test30 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入想要计算的数组个数：");
        int num = sc.nextInt();

        double [] str =new double[num];
        double sum = 0;

        System.out.println("请分别输入数组内的分数：");


        for (int i = 0;i <str.length;i++){
            str[i] = sc.nextInt();
            sum = sum +str[i];
        }
        System.out.println("总分为："+sum);
        System.out.println("分数列表的平均分为："+sum/str.length);

    }
}
